package com.greenhouse.business.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.greenhouse.business.domain.BizDevice;
import com.greenhouse.business.mapper.BizDeviceMapper;
import com.greenhouse.business.service.IBizDeviceService;
import com.greenhouse.common.utils.DateUtils;

/**
 * 设备管理Service业务层处理
 * 
 * @author greenhouse
 * @date 2021-04-12
 */
@Service
public class BizDeviceServiceImpl implements IBizDeviceService {
	@Autowired
	private BizDeviceMapper bizDeviceMapper;

	/**
	 * 查询设备管理
	 * 
	 * @param deviceId 设备管理ID
	 * @return 设备管理
	 */
	@Override
	public BizDevice selectBizDeviceById(Long deviceId) {
		return bizDeviceMapper.selectBizDeviceById(deviceId);
	}

	/**
	 * 查询设备管理列表
	 * 
	 * @param bizDevice 设备管理
	 * @return 设备管理
	 */
	@Override
	public List<BizDevice> selectBizDeviceList(BizDevice bizDevice) {
		return bizDeviceMapper.selectBizDeviceList(bizDevice);
	}

	/**
	 * 新增设备管理
	 * 
	 * @param bizDevice 设备管理
	 * @return 结果
	 */
	@Override
	public int insertBizDevice(BizDevice bizDevice) {
		bizDevice.setCreateTime(DateUtils.getNowDate());
		return bizDeviceMapper.insertBizDevice(bizDevice);
	}

	/**
	 * 修改设备管理
	 * 
	 * @param bizDevice 设备管理
	 * @return 结果
	 */
	@Override
	public int updateBizDevice(BizDevice bizDevice) {
		bizDevice.setUpdateTime(DateUtils.getNowDate());
		return bizDeviceMapper.updateBizDevice(bizDevice);
	}

	/**
	 * 批量删除设备管理
	 * 
	 * @param deviceIds 需要删除的设备管理ID
	 * @return 结果
	 */
	@Override
	public int deleteBizDeviceByIds(Long[] deviceIds) {
		return bizDeviceMapper.deleteBizDeviceByIds(deviceIds);
	}

	/**
	 * 删除设备管理信息
	 * 
	 * @param deviceId 设备管理ID
	 * @return 结果
	 */
	@Override
	public int deleteBizDeviceById(Long deviceId) {
		return bizDeviceMapper.deleteBizDeviceById(deviceId);
	}

	@Override
	public List<BizDevice> selectBizDeviceByIds(Long[] deviceIds) {
		// TODO Auto-generated method stub
		return bizDeviceMapper.selectBizDeviceByIds(deviceIds);
	}
}
